﻿<%@ Application Language="C#" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e) 
    {
        // Code that runs on application startup

    }
    
    void Application_End(object sender, EventArgs e) 
    {
        //  Code that runs on application shutdown

    }
        
    void Application_Error(object sender, EventArgs e) 
    { 
        // Code that runs when an unhandled error occurs

    }

    void Session_Start(object sender, EventArgs e) 
    {
        DataBase.OpenConnection();
        Session["isLogIn"] = "false";
        Session["login"] = "";
        
    }

    void Session_End(object sender, EventArgs e) 
    {
        DataBase.CloseConnection();
        Session["isLogIn"] = "false"; //automatyczne wylogowanie po zamknieciu sesji 
        Session["login"] = "";     
    }
       
</script>
